import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/double_control/instrument_ledger_count_entity.dart';

InstrumentLedgerCountEntity $InstrumentLedgerCountEntityFromJson(Map<String, dynamic> json) {
  final InstrumentLedgerCountEntity instrumentLedgerCountEntity = InstrumentLedgerCountEntity();
  final int? normal = jsonConvert.convert<int>(json['normal']);
  if (normal != null) {
    instrumentLedgerCountEntity.normal = normal;
  }
  final int? upperLimitCount = jsonConvert.convert<int>(json['upperLimitCount']);
  if (upperLimitCount != null) {
    instrumentLedgerCountEntity.upperLimitCount = upperLimitCount;
  }
  final int? maxUpperLimitCount = jsonConvert.convert<int>(json['maxUpperLimitCount']);
  if (maxUpperLimitCount != null) {
    instrumentLedgerCountEntity.maxUpperLimitCount = maxUpperLimitCount;
  }
  final int? lowerLimitCount = jsonConvert.convert<int>(json['lowerLimitCount']);
  if (lowerLimitCount != null) {
    instrumentLedgerCountEntity.lowerLimitCount = lowerLimitCount;
  }
  final int? minLowerLimitCount = jsonConvert.convert<int>(json['minLowerLimitCount']);
  if (minLowerLimitCount != null) {
    instrumentLedgerCountEntity.minLowerLimitCount = minLowerLimitCount;
  }
  return instrumentLedgerCountEntity;
}

Map<String, dynamic> $InstrumentLedgerCountEntityToJson(InstrumentLedgerCountEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['normal'] = entity.normal;
  data['upperLimitCount'] = entity.upperLimitCount;
  data['maxUpperLimitCount'] = entity.maxUpperLimitCount;
  data['lowerLimitCount'] = entity.lowerLimitCount;
  data['minLowerLimitCount'] = entity.minLowerLimitCount;
  return data;
}

extension InstrumentLedgerCountEntityExtension on InstrumentLedgerCountEntity {
  InstrumentLedgerCountEntity copyWith({
    int? normal,
    int? upperLimitCount,
    int? maxUpperLimitCount,
    int? lowerLimitCount,
    int? minLowerLimitCount,
  }) {
    return InstrumentLedgerCountEntity()
      ..normal = normal ?? this.normal
      ..upperLimitCount = upperLimitCount ?? this.upperLimitCount
      ..maxUpperLimitCount = maxUpperLimitCount ?? this.maxUpperLimitCount
      ..lowerLimitCount = lowerLimitCount ?? this.lowerLimitCount
      ..minLowerLimitCount = minLowerLimitCount ?? this.minLowerLimitCount;
  }
}
